package com.teach.vo;

import com.teach.dao.Demo08;
import com.teach.dao.Demo09;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-01 15:08
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class Demo03 extends Demo08 {

  public void test() {
    Demo03 d3 = new Demo03();//同类
    Demo04 d4 = new Demo04();//同包内
    Demo08 d8 = new Demo08();//不同包的子类
    Demo09 d9 = new Demo09();//不同包的非子类

    d3.show();
    d4.show();
    d8.show();
    super.show();
    d9.show();

    d3.show1();
    d4.show1();
//    d8.show1();
    super.show1();//子类的方法可以通过super关键字方法父类受保护的方法
//    d9.show1();

    d3.show2();
    d4.show2();
//    d8.show2();
//    super.show2();
//    d9.show2();

    d3.show3();
//    d4.show3();
//    d8.show3();
//    super.show3();
//    d9.show3();
  }

  public void show(){
    System.out.println("同类的公开方法");
  }

  protected void show1(){
    System.out.println("同类受保护的方法");
  }

  void show2(){
    System.out.println("同类默认的方法");
  }

  private void show3(){
    System.out.println("同类的私有方法");
  }


}
